<?php
declare (strict_types = 1);

namespace app\service;

use app\dao\ScoreDao;
use app\model\Score;

class ScoreService extends \think\Service
{
    protected $scoreao;
    public function __construct()
    {
        $this->scoreao = new ScoreDao();
    }
    public function getScore(){
        $score = $this->scoreao
            ->getField(['id','name','title'])
            ->getAll();
        return $score;
    }
    public function updateScore($id){
        try {
            return $this->scoreao->updateById('status',1, $id);
        }catch (\Exception $exception){

        }
    }
    public function deleteScore($id){
        try {
            return $this->scoreao->delete($id);
        }catch (\Exception $exception){

        }
    }
}
